'use strict';
module.exports = {
	/**
	 * XXXnameXXX
	 * @url client/pay/kh/prompt_msg 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let {
			data = {}, userInfo, util, filterResponse, originalParam
		} = event;
		
		let {
			uid,
			tv_id,
			appid,
			tv_name,
			reason
		} = data;
		let res = {
			code: 0,
			msg: ""
		};
		// 业务逻辑开始-----------------------------------------------------------
		let dbName = "prompt_msg"; // 表名
		// 执行 数据库add 命令
		res.id = await vk.baseDao.add({
			dbName,
			dataJson: {
				nickname: userInfo.nickname || '匿名用户',
				uid,
				tv_id:tv_id || '',
				tv_name:tv_name || '',
				appid,
				appname: userInfo.appname,
				reason:reason || ''
			}
		});
		// 参数验证结束
	
		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
